//
//  FoodTabBarViewController.swift
//  Food
//
//  Created by 罗林轩 on 2023/12/16.
//

import UIKit

class FoodTabBarViewController: UITabBarController {
    override func viewDidLoad() {
        super.viewDidLoad()
        let edit = FoodEditViewController()
        let editTabBarItem = UITabBarItem(title: "编辑", image: UIImage(named: "edit_nor"), selectedImage: UIImage(named: "edit_sel")?.withRenderingMode(.alwaysOriginal))
        editTabBarItem.setTitleTextAttributes([.foregroundColor:GlobalConstants.MainColor],
                                              for: .selected)
        edit.tabBarItem = editTabBarItem
        
        let list = FoodListViewController()
        let listTabBarItem =  UITabBarItem(title: "列表", image: UIImage(named: "list_nor"), selectedImage: UIImage(named: "list_sel")?.withRenderingMode(.alwaysOriginal))
        listTabBarItem.setTitleTextAttributes([.foregroundColor:GlobalConstants.MainColor],
                                              for: .selected)
        list.tabBarItem = listTabBarItem
        self.viewControllers = [edit,list]
    }
}
